<?php
@header("Content-type:text/html;charset=GB2312");
defined('BASEPATH') OR exit('No direct script access allowed');

class Article extends CI_Controller
{
    function index(){
        $my = $this->load->database('default', TRUE);
        $ms = $this->load->database('sqlserver', TRUE);
        $size = 500;
        $page = isset($_GET['page']) ? $_GET['page'] : 1;
        $zongshu = $page * $size;

        $sql = "select top $size * from (select top $zongshu  * from NC_Article order by ArticleID asc) NC_Article order by ArticleID desc";
        $msq = $ms->query($sql)->result_array();
        $m = array();
        foreach($msq as $v){
            $k = array(
                'ArticleID'=> $v['ArticleID'],
                'ChannelID'=> $v['ChannelID'],
                'ClassID'=> $v['ClassID'],
                'SpecialID'=> $v['SpecialID'],
                'title'=> $v['title'],
                'subtitle'=> $v['subtitle'],
                'ColorMode'=> $v['ColorMode'],
                'FontMode'=> $v['FontMode'],
                'BriefTopic'=> $v['BriefTopic'],
                'content'=> $v['content'],
                'OuterLinks'=> $v['OuterLinks'],
                'Related'=> $v['Related'],
                'Author'=> $v['Author'],
                'ComeFrom'=> $v['ComeFrom'],
                'isTop'=> $v['isTop'],
                'AllHits'=> $v['AllHits'],
                'DayHits'=> $v['DayHits'],
                'WeekHits'=> $v['WeekHits'],
                'MonthHits'=> $v['MonthHits'],
                'HitsTime'=> $v['HitsTime'],
                'WriteTime'=> $v['WriteTime'],
                'HtmlFileDate'=> $v['HtmlFileDate'],
                'username'=> $v['username'],
                'star'=> $v['star'],
                'isBest'=> $v['isBest'],
                'ImageUrl'=> $v['ImageUrl'],
                'UploadImage'=> $v['UploadImage'],
                'UserGroup'=> $v['UserGroup'],
                'PointNum'=> $v['PointNum'],
                'isUpdate'=> $v['isUpdate'],
                'isAccept'=> $v['isAccept'],
                'ForbidEssay'=> $v['ForbidEssay'],
                'AlphaIndex'=> $v['AlphaIndex'],
                'AutoPages'=> $v['AutoPages'],
                'isxmltext'=> $v['isxmltext'],
                'xmlfilename'=> $v['xmlfilename'],
            );
            $m[] = $k;
        }
        var_dump("<pre>");
        var_dump($m);
    }
}